#include <string>

using namespace std;

class Solution
{
public:
    string reverseLeftWords(string s, int n)
    {
        string ret;
        int len = s.size();
        if (n > len)
        {
            n = n % len;
        }
        int i = n;
        while (i != n - 1)
        {
            ret.push_back(s[i]);
            i = (i + 1 + len) % len;
        }
        ret.push_back(s[i]);
        return ret;
    }
};